package com.flong.gui;
import java.awt.Frame;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class TFActionEvent {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new F1();
	}

}

class F1 extends Frame
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	F1()
	{
		TextField tf = new TextField();
		add(tf);
		tf.addActionListener(new TFActionListener());
		pack();
		setVisible(true);
	}
}

class TFActionListener implements ActionListener
{
	public void actionPerformed(ActionEvent e)
	{
		TextField tf = (TextField)e.getSource();
		System.out.println(tf.getText());
		//tf.setText("");
	}
}
